package com.cm.caseManagement.service.impl;


import com.cm.caseManagement.dao.CmCaseWarningMapper;
import com.cm.caseManagement.pojo.entity.CmCaseWarning;
import com.cm.caseManagement.service.ICmCaseWarningService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cm.caseManagement.utils.DateUtils;

import java.util.List;

/**
 * 案件预警Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmCaseWarningServiceImpl implements ICmCaseWarningService
{
    @Autowired
    private CmCaseWarningMapper cmCaseWarningMapper;

    /**
     * 查询案件预警
     *
     * @param id 案件预警主键
     * @return 案件预警
     */
    @Override
    public CmCaseWarning selectCmCaseWarningById(Long id)
    {
        return cmCaseWarningMapper.selectCmCaseWarningById(id);
    }

    /**
     * 查询案件预警列表
     *
     * @param cmCaseWarning 案件预警
     * @return 案件预警
     */
    @Override
    public List<CmCaseWarning> selectCmCaseWarningList(CmCaseWarning cmCaseWarning)
    {
        return cmCaseWarningMapper.selectCmCaseWarningList(cmCaseWarning);
    }

    /**
     * 新增案件预警
     *
     * @param cmCaseWarning 案件预警
     * @return 结果
     */
    @Override
    public int insertCmCaseWarning(CmCaseWarning cmCaseWarning)
    {
        cmCaseWarning.setCreateTime(DateUtils.getNowDate());
        return cmCaseWarningMapper.insertCmCaseWarning(cmCaseWarning);
    }

    /**
     * 修改案件预警
     *
     * @param cmCaseWarning 案件预警
     * @return 结果
     */
    @Override
    public int updateCmCaseWarning(CmCaseWarning cmCaseWarning)
    {
        cmCaseWarning.setUpdateTime(DateUtils.getNowDate());
        return cmCaseWarningMapper.updateCmCaseWarning(cmCaseWarning);
    }

    /**
     * 批量删除案件预警
     *
     * @param ids 需要删除的案件预警主键
     * @return 结果
     */
    @Override
    public int deleteCmCaseWarningByIds(Long[] ids)
    {
        return cmCaseWarningMapper.deleteCmCaseWarningByIds(ids);
    }

    /**
     * 删除案件预警信息
     *
     * @param id 案件预警主键
     * @return 结果
     */
    @Override
    public int deleteCmCaseWarningById(Long id)
    {
        return cmCaseWarningMapper.deleteCmCaseWarningById(id);
    }
}
